<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <script src="./面向对象.js"></script> -->
    <!-- <script src="es6面向对象.js"></script> -->
    <script src="./36-13-手写Promise-then回调函数的异步执行.js"></script>
</head>
<body>
    <script>
         let p =new Promise((res,rej)=>{
             res('ok')
            // rej('error')

            // throw '错误'
         })
         console.log(p);

         let p2 = p.then(val=>{
             console.log(val);
             return new Promise((res)=>{
                 res('okk')
             });
         },rea=>{
             console.log(rea);
         })

         p2.then(val=>{
             console.log(val);
         })

         let p3 = Promise.resolve('ok')
         let p4 = Promise.reject('err')

         console.log(p3);
         console.log(p4);


        //  let mengnan = new Person();

        //  let xiaozhang = new Person('180cm','55kg','24')

        //  console.log(mengnan);

        // //  xiaozhang.name = '王守义';
        // xiaozhang.havename('王大拿');

        // console.log(xiaozhang);

        // //  mengnan.name = '老干妈';
        // mengnan.havename('加多宝');
        // console.log(mengnan);

        // let bf =new Boyfriend('157cm','80kg','6');


        // console.log(bf);

        // bf.run();

        // bf.havename('土豆子')
        // console.log(bf);

        // Person.jump()

        // let np = new Person('xiaoli','66')
    
        // console.log(np);

        // np.run()

        // Person.down();

        // let gf = new girlFs('小花','16');

        // console.log(gf);

        // gf.run();

        // // 静态方法调用
        // girlFs.down();


        // gf.jump();

        // np.jump(); //不能调用子类方法

    </script>

</body>
</html>